package cn.carl.frame.core.config;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

public class Model {
	protected Map<Object, Object> para;
	{
		para = new ConcurrentHashMap<Object, Object>();
	}

	public Model set(Object key, Object value) {
		para.put(key, value);
		return this;
	}

	public Object get(Object key) {
		return para.get(key);
	}

	public Set<Object> keys() {
		return para.keySet();
	}

	public Set<Object> values() {
		Set<Object> keys = keys();
		Set<Object> values = new HashSet<Object>();
		keys.forEach((a)->{
			values.add(para.get(a));
		});
		return values;
	}

	@Override
	public String toString() {
		return "Model [para=" + para + "]";
	}

}
